import request from '../utils/request';

// 获取摄像头列表
export const getCameraList = () => {
  return request.get('/camera/list');
};
// 获取摄像头详情
export const getCameraDetail = (data) => {
  return request.get('/camera/info', data);
};
// 创建摄像头
export const createCamera = (data) => {
  return request.post('/camera/add', data);
};

// 修改摄像头基础信息
export const updateCameraBasic = (data) => {
  return request.post('/camera/update-basic', data);
};

// 修改摄像头路径配置信息
export const updateCameraPath = (data) => {
  return request.post('/camera/update-path', data);
};

// 修改摄像头IR参数信息
export const updateCameraIR = (data) => {
  return request.post('/camera/update-ir', data);
};

// 修改摄像头增益信息
export const updateCameraGain = (data) => {
  return request.post('/camera/update-gain', data);
};

// 修改摄像头模式信息
export const updateCameraMode = (data) => {
  return request.post('/camera/update-mode', data);
};

// 修改摄像头电晕颜色信息
export const updateCameraColor = (data) => {
  return request.post('/camera/update-color', data);
};

// 修改摄像头报警设置
export const updateCameraAlarm = (data) => {
  return request.post('/camera/update-alarm', data);
};

// 修改摄像头转动速度
export const updateCameraSpeed = (data) => {
  return request.post('/camera/update-speed', data);
};

// 获取路径巡航名称
export const getPathById = (data) => {
  return request.post('/camera/get-path', data);
};

// 添加路径巡航名称
export const addPath = (data) => {
  return request.post('/camera/add-path', data);
};

// 获取预置点名称
export const getPresetList = (data) => {
  return request.post('/camera/get-preset', data);
};

// 添加预置点名称
export const addPreset = (data) => {
  return request.post('/camera/add-preset', data);
};

// 删除预置点名称
export const deletePreset = (data) => {
  return request.post('/camera/del-preset', data);
};

// 文件上传
export const uploadFile = (data) => {
  return request.post('/camera/upload', data, {
    headers: {
      'Content-Type': 'multipart/form-data',
    },
  });
};

/**
 * 获取websocket接收的消息
 */
export const getWebsocketMessage = (data) => {
  return request.post('/camera/get-websocket-message', data);
};
